package com.example.user_service.dao;

import com.example.user_service.vo.Administrator;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface UserDelete
{
    /* 删除管理员
     * @author Liu
     * @date 2021/12/15 2:14
     * @param null
     * @return
     * @throws
     * @since
     */
    @Delete("delete from administrator where account = ${account};"+
            "delete from user_role where user_id = ${account};"+
            "delete from user_data where user_id = ${account};"+
            "delete from user_login where user_id = ${account};")
    int delete_Administrator(Administrator administrator);


    /* 根据id删除我的足迹
     * @author Liu
     * @date 2021/12/17 14:46
     * @param null
     * @return
     * @throws
     * @since
     */
    @Delete("delete from my_tracks where tracksid = ${tracks_id}")
    int delete_my_tracks(int tracks_id);

    /* 根据时间删除足迹
     * @author Liu
     * @date 2021/12/19 17:13
     * @param null
     * @return
     * @throws
     * @since
     */
    @Delete("delete from my_tracks where user_id = ${userid} and tracks_create = '${replaceFirst}'")
    int delete_my_tracks_date(int userid, String replaceFirst);

    /* 我的收藏删除
     * @author Liu
     * @date 2021/12/20 0:22
     * @param null
     * @return
     * @throws
     * @since
     */
    @Delete("delete from collect_goods where goods_id = ${goods_id}")
    int delete_collect_goods(int goods_id);



}
